package edu.sctu.renpingan.mysubwaysystem.util;

import edu.sctu.renpingan.mysubwaysystem.appbean.PeopleAppbean;
import edu.sctu.renpingan.mysubwaysystem.data.SetPeopleData;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Administrator on 2015/6/7.
 */
public class PeopleTimeDeth extends SubwayCardDeth implements Runnable{

    private PeopleAppbean peopleappbean;

    public PeopleTimeDeth(PeopleAppbean peopleappbean){

        this.peopleappbean = peopleappbean;
    }
    public long getgetintimestamp(){
        Date date = new Date();


        long getintimestamp = date.getTime();

        return  getintimestamp;
    }
   SetPeopleData setPeopleData = new SetPeopleData();

    public int  getgetouttime(){
        int k = conutStationNumber(setPeopleData.setpeopledata().get(0).getStart(),setPeopleData.setpeopledata().get(0).getEnd());

        return k;
    }
    Thread thread = new Thread();
    @Override
    public void run() {
        Date date = new Date();
        String date0 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(date);
        System.out.println("进站时间："+date0+"  "+"乘车中...");
        try {
            Thread.sleep(getgetouttime() * 2 * 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        long getouttimetimestamp = getgetintimestamp()+getgetouttime()*2000;
        String date2 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(getouttimetimestamp);
        System.out.println("出站时间："+date2);
    }
}
